package com.ysh.springdemo;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/calc")
public class CalcController {
    @RequestMapping("/sum")
    public String sum(Integer num1,Integer num2){
        if(num1==null||num2==null){
            return "参数错误，无法返回";
        }
        Integer sum = num1+num2;
        return "<h1>返回两数之和： "+sum+"<h1>";
    }
}
